import image

def find_line(img):
    line = img.get_regression([(100,100)], robust = True)

    if (line):
        rho_err = round(abs(line.rho())-img.width()/2)

        if line.theta()>90:
            theta_err = line.theta()-180
        else:
            theta_err = line.theta()

        return rho_err, theta_err, line.magnitude()
    else:
        return 0, 0, 0
